#ifndef AXBOPENGLWIDGET_H
#define AXBOPENGLWIDGET_H

#include <QWidget>
#include <QOpenGLWidget>
#include <QOpenGLFunctions_3_3_Core> // for OpenGL核心模式
#include <QOpenGLShaderProgram>

class AXBOpenGLWidget : public QOpenGLWidget, QOpenGLFunctions_3_3_Core
{
    Q_OBJECT
public:
    typedef enum Shape { None, Rect, Circle, Triangle } Shape;
    explicit AXBOpenGLWidget(QWidget *parent = nullptr);
    ~AXBOpenGLWidget();

    void drawShape(Shape shape);
    void setWireframe(bool wireframe);

signals:

protected:
    virtual void initializeGL();
    virtual void resizeGL(int w, int h);
    virtual void paintGL();

private:
    Shape m_shape;
    QOpenGLShaderProgram shaderProgram;
};

#endif // AXBOPENGLWIDGET_H
